Simplicty and flexibility!


Command::

Modify Records


Parameters


Returns/Result


Examples


Reference

Modify Records

Type

Processing Command

Purpose

The modify records command modifies records in a specified table.

Syntax

modify records [in TABLENAME|RELATIONSHIP] [named "UNIQUE RELATIONSHIP NAME" ]] [with  ( selection criteria) ] FIELDNAME := MODIFIED VALUE ;|.

Usage

The modify records command must specify the field values to be changed in the Target table. The Target table may be the Primary table specified at the start of a for command, or a related table specified within a for loop.

When you modify records in the Primary table, the keyword in is omitted and no punctuation is used after the modify records command (see Example 1). If no selection criteria are specified, all the records in the Primary table are modified.

When you modify records in a table other than the Primary table, the keyword in precedes the table name, and the command ends with the appropriate punctuation mark (a semicolon or a period - see Example 2). If no selection criteria are specified, all the records in the specified table are modified.

Source data used to modify records may come from the Primary table, a Data-entry form, system variable, or calculation. Alternatively, you can use the copy all from command to specify a Source table from which to copy field data.

As data is entered in the Target table, automatic error checking is performed. Errors are logged to an error file.

You cannot list or modify more than 255 fields in a single DQL Procedure.

Example 1

for MEMBERS with ( any RESERVATIONS TOTAL DUE > 3000) ;

modify records

TOTAL DUE := ( TOTAL DUE - data-entry DISCOUNT) .

end

 

This script tells DataEase: (1) Process all the MEMBERS records that have any related RESERVATIONS record with a TOTAL DUE greater than $3000, and (2 ) modify each MEMBERS record by subtracting the DISCOUNT amount entered in the Data-entry form from the value in the TOTAL DUE field in the MEMBERS table.

Example 2

for MEMBERS with STATE = "NY" ;

modify records in RESERVATIONS

TOTAL DUE := TOTAL DUE + NY SALES TAX .

end

 

This script tells DataEase: (1) Process all the MEMBERS records that have NY in the STATE field, and (2) for each MEMBERS record that is processed, find all the related records in the RESERVATIONS table. Modify each related RESERVATIONS record by adding the NY SALES TAX amount to the value in the TOTAL DUE field.

See Also


On the forum about Modify Records

How to modify records in a table from a csv-file

Hi,I want to update records in my app from a csv-file. The csv-file holding only 2 fields; 1) e-mail adress and 2) a number. Both fields are defined in my app. The e-mail adress is unique.Can anybody tell me how to do it?Thanks</p...

Product: Dataease [{8}]FIVE. Written by Per Bruvold 08/07/15 at 08:38:30

Re:How to modify records in a table from a csv-file

I forget to mention that the form have several fields but I want only to update the number-field....

Product: Dataease [{8}]FIVE. Written by Per Bruvold 08/07/15 at 08:57:11

Re:How to modify records in a table from a csv-file and DataEase Uniqueness discussed

There si many ways to do this but I will give you two:1. The standard/default way and how it should work.Simply create a fixed import by field name and run it. DataEase default functionality is to insert records if new and...

Product: Dataease [{8}]FIVE. Written by DataEase 08/07/15 at 09:12:40

Re:Re:How to modify records in a table from a csv-file and DataEase Uniqueness discussed

Tanks, that solve my issue!...

Product: Dataease [{8}]FIVE. Written by Per Bruvold 08/07/15 at 10:58:11

Modify Records

We are revamping/upgrading from DataEase 6.52 to 8.5. &nbsp;When I run the attached language I receive an error dialog box and when I click to see the message it reflects "Record already exists". &nbsp;Does anyone have any thoughts? &nbsp;Attached is...

Product: Dataease [{8}]FIVE. Written by Karen Miller 06/03/17 at 18:28:46

Re:Modify Records

Most likely something wrong with the Unique Key.Try to switch it off all unique constraints, save and reorganise.Then try to switch them back on again.You can try to reorganise the table only first if you prefer....

Product: Dataease [{8}]FIVE. Written by DataEase 06/03/17 at 20:19:25

On the blog about Modify Records


dg3_HelpView